using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using SharpErp.UI.BasicData.FeeType;

namespace SharpErp.UI.BasicData
{
    public partial class DepartmentInfoPrintDialog : UI.Common.BaseDialogForm
    {
        public List<Data.Common.View.CompanyStaffView> Items { get; set; }

        public string ReportTitle { get; set; }

        public string HeadIconPath { get; set; }

        public DepartmentInfoPrintDialog()
        {
            InitializeComponent();

            AfterLoad += GoodsInfoPrintDialog_AfterLoad;
        }

        private void GoodsInfoPrintDialog_AfterLoad(object sender, EventArgs e)
        {
            var source = new DepartmentInfoReport();
            source.SetDataSource(Items);
            if (!string.IsNullOrEmpty(ReportTitle))
            {
                source.SetTitle(ReportTitle);
            }
            if (!string.IsNullOrEmpty(HeadIconPath))
            {
                source.SetHeadIcon(HeadIconPath);
            }
            this.documentViewer1.DocumentSource = source;
            source.CreateDocument();
        }
    }
}